using System;
using System.Collections.Generic;
using System.Text;

namespace LogParser.DA
{
    class WeaponListModel
    {
        //DataSets.WeaponsDSTableAdapters.WeaponsTableAdapter wta;

        DA.DataObjects.WeaponsDSTableAdapters.WeaponsTableAdapter wta;

        public WeaponListModel()
        {
            Initialize();
        }

        private void Initialize( )
        {
            wta = TableAdapters.WeaponsTableAdapter();
        }


        public List<GameObjects.Weapon> GetWeaponsList( )
        {
            List<GameObjects.Weapon> returnObjects = new List<LogParser.GameObjects.Weapon>();

            DA.DataObjects.WeaponsDS.WeaponsDataTable wdt = wta.GetData();

            foreach ( DA.DataObjects.WeaponsDS.WeaponsRow wr in wdt.Rows )
            {
                GameObjects.Weapon temp = new LogParser.GameObjects.Weapon();
                temp.FullName = wr.WeaponFullName;
                temp.Name = wr.WeaponShortName;
                temp.WeaponID = wr.WeaponId;

                returnObjects.Add( temp );
            }

            return returnObjects;
        }
    }
}
